# from sqlalchemy.exc import DatabaseError
from werkzeug.utils import redirect

from application import app
from common.libs.UrlManager import UrlManager


@app.errorhandler(404)
def error_404(e):
    return redirect(UrlManager.buildUrl('/error/404'))


@app.errorhandler(Exception)
def error_500(e):
    return redirect(UrlManager.buildUrl('/error/500'))
